package com.example.chcrm.entity.common;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Author 邹
 * @Date 2025/4/17 19:12
 * @Version 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class OperateRecord implements Serializable {

    private static final long serialVersionUID = 1L;

    public static final String OPE_ADD="添加";
    public static final String OPE_DELETE="删除";
    public static final String OPE_UPDATE="更改";
    public static final String OPE_SELECT="查询";
    public static final String OPE_PASS="通过";
    public static final String OPE_REFUSE="拒绝";
    public static final String OPE_OPEN="启用";
    public static final String OPE_CLOSE="禁用";
    public static final String OPE_RECEIVE="接收";
    public static final String OPE_CANCEL="取消";
    public static final String OPE_FAULT="故障";
    public static final String OPE_FAULT_CLOSE="故障解除";
    public static final String OPE_DELIVERY_SUCCESS="交车成功";
    //库位状态
    public static final String OPE_STATUS_FREE = "空闲中";
    public static final String OPE_STATUS_REPAIR = "维修中";
    public static final String OPE_STATUS_USE = "使用中";

    /**
     * 主键
     */
    @TableId(value = "id", type= IdType.INPUT)
    private String id;

    /**
     * 操作类型
     */
    @TableField("operateType")
    private String operateType;

    /**
     * 操作时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private String createTime;

    /**
     * 操作人id
     */
    @TableField("operationId")
    private String operationId;

    /**
     * 被操作数据Id
     */
    @TableField("sourceId")
    private String sourceId;

    /**
     * 说明
     */
    private String remark;

    /**
     * 操作人姓名
     */
    @TableField("operationName")
    private String operationName;

    /**
     * 操作人电话
     */
    @TableField("operationPhone")
    private String operationPhone;

    private String address;

    private Integer partYearMonth = Integer.parseInt(new SimpleDateFormat("yyyyMM").format(new Date()));//分区年月

}